<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Bottomnav extends Model
{
    protected $guarded = [];

    public function subnavs() {
    	return $this->hasMany(Bottomnav::class, 'pid');
    }

    public function scopeTopnav($query) {
    	return $query->whereNull('pid');
    }
}
